//
//  ViewController.m
//  计算器
//
//  Created by administrator on 13-7-31.
//  Copyright (c) 2013年 yy. All rights reserved.
//

#import "ViewController.h"
#import "caculator.h"
#import "add.h"




@interface ViewController ()
@property (weak, nonatomic) IBOutlet UILabel *displayLabel;
@property (assign,nonatomic)BOOL isUserInputingNumber;



@end

@implementation ViewController

@synthesize displayLabel=_displayLabel;
@synthesize isUserInputingNumber=_isUserInputingNumber;


- (IBAction)opratebutton:(id)sender

{
 NSString*


}



    



//清空键
- (IBAction)clearbutton:(UIButton *)sender

{
    self.displayLabel.text=@"0";
    self.isUserInputingNumber= NO;
}





//数字键
- (IBAction)numbutton:(UIButton *)sender
{
    NSLog(@"%@",sender.currentTitle);
    if (self.isUserInputingNumber)
    
    {
        long inputNum=[self.displayLabel.text longLongValue];
        inputNum=inputNum*10+[sender.currentTitle intValue];
        
        self.displayLabel.text=[NSString stringWithFormat:@"%ld",inputNum];
    }

    else
    {
        [self.displayLabel setText:sender.currentTitle];
        self.isUserInputingNumber=YES;
    }
}








- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
